package com.tech.zhidengxian.controller;

import com.tech.zhidengxian.model.dto.CommentDTO;
import com.tech.zhidengxian.model.dto.GoodsDTO;
import com.tech.zhidengxian.model.dto.PurchaseDTO;
import com.tech.zhidengxian.model.dto.page.MyPage;
import com.tech.zhidengxian.model.dto.request.PurchaseRequest;
import com.tech.zhidengxian.model.dto.result.ReturnResult;
import com.tech.zhidengxian.model.dto.result.ReturnResultUtils;
import com.tech.zhidengxian.service.api.PurchaseService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Ljh
 * @date 2023/5/14 23:49
 * @description
 **/
@RestController
@RequestMapping("/purchase")
public class PurchaseController {
    @Resource
    private PurchaseService purchaseService;
    @RequestMapping("/pageQueryPurchase")
    public ReturnResult<MyPage<PurchaseDTO>> pageQueryPurchase(@RequestBody PurchaseRequest purchaseRequest){
        return ReturnResultUtils.returnSuccess(purchaseService.pageQuery(purchaseRequest));
    }
}
